﻿' ***********************************************************************
' Assembly         : Ioc
' Author           : Tim Ford
' Created          : 10-02-2013
'
' Last Modified By : Tim Ford
' Last Modified On : 10-02-2013
' ***********************************************************************
' <copyright file="CacheKeyModificationAttribute.vb" company="Red Baron Solutions">
'     Red Baron Solutions. All rights reserved.
' </copyright>
' <summary></summary>
' ***********************************************************************


Namespace Ioc.Attributes
    ''' <summary>
    ''' 	
    ''' </summary>
    <AttributeUsage(AttributeTargets.Parameter, AllowMultiple:=False)> _
    Public NotInheritable Class CacheKeyModificationAttribute
        Inherits Attribute


        ''' <summary>
        ''' Initializes a new instance of the <see cref="CacheKeyModificationAttribute" /> class.	
        ''' </summary>
        ''' <param name="doNotUseAsCacheKey">The do not use as cache key.</param>
        ''' <remarks></remarks>
        Public Sub New(doNotUseAsCacheKey As Boolean)
            m_DoNotUseAsCacheKey = doNotUseAsCacheKey
            m_MethodOrPropertyToUseAsCacheKey = ""
        End Sub

        ''' <summary>
        ''' Initializes a new instance of the <see cref="CacheKeyModificationAttribute" /> class.	
        ''' </summary>
        ''' <param name="methodOrPropertyToUseAsCacheKey">The method or property to use as cache key.</param>
        ''' <remarks></remarks>
        Public Sub New(methodOrPropertyToUseAsCacheKey As String)
            m_DoNotUseAsCacheKey = False
            m_MethodOrPropertyToUseAsCacheKey = methodOrPropertyToUseAsCacheKey
        End Sub

        ''' <summary>
        ''' Gets the do not use as cache key.	
        ''' </summary>
        ''' <value></value>
        ''' <remarks></remarks>
        Public ReadOnly Property DoNotUseAsCacheKey() As Boolean
            Get
                Return m_DoNotUseAsCacheKey
            End Get
        End Property
        Private ReadOnly m_DoNotUseAsCacheKey As Boolean

        ''' <summary>
        ''' Gets the method or property to use as cache key.	
        ''' </summary>
        ''' <value></value>
        ''' <remarks></remarks>
        Public ReadOnly Property MethodOrPropertyToUseAsCacheKey() As String
            Get
                Return m_MethodOrPropertyToUseAsCacheKey
            End Get
        End Property
        Private ReadOnly m_MethodOrPropertyToUseAsCacheKey As String



    End Class
End Namespace